const { defineConfig } = require('@vue/cli-service')
const path = require('path')

module.exports = defineConfig({
    transpileDependencies: true,

    configureWebpack: {
        resolve: {
            alias: {
                '@': path.resolve(__dirname, 'src')  // 让 @ 指向 src 目录
            }
        }
    },
    devServer: {
        proxy: {
            '/api': {
                target: 'http://118.24.22.205',
                changeOrigin: true,
                pathRewrite: {
                    '^/api': '' // 去掉 /api 前缀
                }
            }
        }
    }
})